﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InterfaceFiles
{
  public class EPASWMM5InterfaceHeader : BaseInterfaceHeader, IInterfaceHeader
  {
    public EPASWMM5InterfaceHeader(IInterfaceReader reader)
      : base(reader)
    {
    }

    public EPASWMM5InterfaceHeader(IInterfaceReader reader, IInterfaceWriter writer)
      : base(reader, writer)
    {
    }

    public override void Write(IInterfaceHeader header)
    {
      writer.WriteString("SWMM5");
      writer.FlushRecord();
      writer.WriteString(header.Titles[0]);
      writer.FlushRecord();
      writer.WriteString("30");
      writer.FlushRecord();
      writer.WriteString("1");
      writer.FlushRecord();
      writer.WriteString("FLOW CFS");
      writer.FlushRecord();
      writer.WriteString(header.NumNodes.ToString());
      writer.FlushRecord();
      foreach(string node in header.Nodes)
      {
        writer.WriteString(node);
        writer.FlushRecord();
      }
      writer.WriteString("NODE YEAR MON DAY HR MIN SEC FLOWCFS");
      writer.FlushRecord();
    }
  }
}
